package cn.wk.enums;

public enum CourseEnum {
    BRONZE(1L,"青铜"),SILVE(2L,"白银"),GOLD(3l,"黄金"),PLATINUM(4L,"铂金");
    private Long id;
    private String name;

    public static CourseEnum getCourseEnum(Long id){
        CourseEnum[] values = CourseEnum.values();
        for(CourseEnum courseEnum:values){
            if(courseEnum.getId() == id){
                return courseEnum;
            }
        }
        return null;
    }

    CourseEnum(Long id, String name) {
        this.id = id;
        this.name = name;
    }

    CourseEnum() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "CourseEnum{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
